package com.itcast.myrpc.pipeline;

import com.itcast.myrpc.decoder.ByteToIntegerDecoder;
import com.itcast.myrpc.handler.ServerHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @program: bio_tcp
 * @description:
 * @author: zhanghz001
 * @create: 2021-02-22 17:48
 **/
public class DecoderChannelInitializer extends ChannelInitializer<SocketChannel> {
    
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        //把业务处理器加入到列表中
        socketChannel.pipeline()
                .addLast(new ByteToIntegerDecoder())
                .addLast(new ServerHandler());
    }
}
